<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template quantity&lt;BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y&gt;</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_units/Reference.html#header.boost.units.quantity_hpp" title="Header &lt;boost/units/quantity.hpp&gt;">
<link rel="prev" href="quantity.html" title="Class template quantity">
<link rel="next" href="subtr_1_3_43_10_2_36_1_1_5.html" title="Struct template subtract_typeof_helper&lt;quantity&lt; unit&lt; Dim, System &gt;, X &gt;, quantity&lt; unit&lt; Dim, System &gt;, Y &gt;&gt;">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="quantity.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_units/Reference.html#header.boost.units.quantity_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="subtr_1_3_43_10_2_36_1_1_5.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.units.quant_1_3_43_10_2_36_1_1_4"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template quantity&lt;BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y&gt;</span></h2>
<p>boost::units::quantity&lt;BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y&gt;</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_units/Reference.html#header.boost.units.quantity_hpp" title="Header &lt;boost/units/quantity.hpp&gt;">boost/units/quantity.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> Y<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html" title="Class template quantity&lt;BOOST_UNITS_DIMENSIONLESS_UNIT(System), Y&gt;">quantity</a><span class="special">&lt;</span><span class="identifier">BOOST_UNITS_DIMENSIONLESS_UNIT</span><span class="special">(</span><span class="identifier">System</span><span class="special">)</span><span class="special">,</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <a class="link" href="dimensionless_type.html" title="Struct dimensionless_type">dimensionless_type</a><span class="special">,</span> <span class="identifier">System</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">Y</span> <span class="special">&gt;</span> <a name="boost.units.quant_1_3_43_10_2_36_1_1_4.this_type"></a><span class="identifier">this_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">Y</span>                                                 <a name="boost.units.quant_1_3_43_10_2_36_1_1_4.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>    
  <span class="keyword">typedef</span> <span class="identifier">System</span>                                            <a name="boost.units.quant_1_3_43_10_2_36_1_1_4.system_type"></a><span class="identifier">system_type</span><span class="special">;</span>   
  <span class="keyword">typedef</span> <a class="link" href="dimensionless_type.html" title="Struct dimensionless_type">dimensionless_type</a>                                <a name="boost.units.quant_1_3_43_10_2_36_1_1_4.dimension_type"></a><span class="identifier">dimension_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <span class="identifier">dimension_type</span><span class="special">,</span> <span class="identifier">system_type</span> <span class="special">&gt;</span>               <a name="boost.units.quant_1_3_43_10_2_36_1_1_4.unit_type"></a><span class="identifier">unit_type</span><span class="special">;</span>     

  <span class="comment">// <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#boost.units.quant_1_3_43_10_2_36_1_1_4construct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_10-bb"><span class="identifier">quantity</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_11-bb"><span class="identifier">quantity</span></a><span class="special">(</span><span class="identifier">value_type</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_12-bb"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_14-bb"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <span class="identifier">dimension_type</span><span class="special">,</span> <span class="identifier">system_type</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
             <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="keyword">explicit</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_15-bb"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <span class="identifier">dimension_type</span><span class="special">,</span> <span class="identifier">system_type</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
                      <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System2<span class="special">,</span> <span class="keyword">typename</span> Y2<span class="special">&gt;</span> 
    <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_17-bb"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <a class="link" href="dimensionless_type.html" title="Struct dimensionless_type">dimensionless_type</a><span class="special">,</span> <span class="identifier">System2</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">Y2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
             <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System2<span class="special">,</span> <span class="keyword">typename</span> Y2<span class="special">&gt;</span> 
    <span class="keyword">explicit</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_18-bb"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <a class="link" href="dimensionless_type.html" title="Struct dimensionless_type">dimensionless_type</a><span class="special">,</span> <span class="identifier">System2</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">Y2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
                      <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System2<span class="special">,</span> <span class="keyword">typename</span> Y2<span class="special">&gt;</span> 
    <span class="keyword">explicit</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_19-bb"><span class="identifier">quantity</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <a class="link" href="dimensionless_type.html" title="Struct dimensionless_type">dimensionless_type</a><span class="special">,</span> <span class="identifier">System2</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">Y2</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
                      <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_13-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
    <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
    <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_16-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <span class="identifier">dimension_type</span><span class="special">,</span> <span class="identifier">system_type</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System2<span class="special">&gt;</span> 
    <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
    <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_20-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">BOOST_UNITS_DIMENSIONLESS_UNIT</span><span class="special">(</span><span class="identifier">System2</span><span class="special">)</span><span class="special">,</span> <span class="identifier">Y</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_9-bb">public member functions</a></span>
  <span class="identifier">BOOST_CONSTEXPR</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_9_1-bb"><span class="keyword">operator</span> <span class="identifier">value_type</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_9_2-bb"><span class="identifier">value</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_9_3-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_9_4-bb"><span class="keyword">operator</span><span class="special">-=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_9_5-bb"><span class="keyword">operator</span><span class="special">*=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_9_6-bb"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_21-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">this_type</span> <a class="link" href="quant_1_3_43_10_2_36_1_1_4.html#id-1_3_43_10_2_36_1_1_4_21_1-bb"><span class="identifier">from_value</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.43.10.2.36.6.4"></a><h2>Description</h2>
<p>Specialization for dimensionless quantities. Implicit conversions between unit systems are allowed because all dimensionless quantities are equivalent. Implicit construction and assignment from and conversion to <code class="computeroutput">value_type</code> is also allowed. </p>
<div class="refsect2">
<a name="id-1.3.43.10.2.36.6.4.3"></a><h3>
<a name="boost.units.quant_1_3_43_10_2_36_1_1_4construct-copy-destruct"></a><code class="computeroutput">quantity</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="id-1_3_43_10_2_36_1_1_4_10-bb"></a><span class="identifier">quantity</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="id-1_3_43_10_2_36_1_1_4_11-bb"></a><span class="identifier">quantity</span><span class="special">(</span><span class="identifier">value_type</span> val<span class="special">)</span><span class="special">;</span></pre>construction from raw <code class="computeroutput">value_type</code> is allowed </li>
<li class="listitem"><pre class="literallayout"><a name="id-1_3_43_10_2_36_1_1_4_12-bb"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <a name="id-1_3_43_10_2_36_1_1_4_14-bb"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <span class="identifier">dimension_type</span><span class="special">,</span> <span class="identifier">system_type</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">,</span> 
           <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>implicit conversion between value types is allowed if allowed for value types themselves </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="id-1_3_43_10_2_36_1_1_4_15-bb"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <span class="identifier">dimension_type</span><span class="special">,</span> <span class="identifier">system_type</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">,</span> 
                    <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>implicit conversion between value types is not allowed if not allowed for value types themselves </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System2<span class="special">,</span> <span class="keyword">typename</span> Y2<span class="special">&gt;</span> 
  <a name="id-1_3_43_10_2_36_1_1_4_17-bb"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <a class="link" href="dimensionless_type.html" title="Struct dimensionless_type">dimensionless_type</a><span class="special">,</span> <span class="identifier">System2</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">Y2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">,</span> 
           <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>implicit conversion between different unit systems is allowed </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System2<span class="special">,</span> <span class="keyword">typename</span> Y2<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="id-1_3_43_10_2_36_1_1_4_18-bb"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <a class="link" href="dimensionless_type.html" title="Struct dimensionless_type">dimensionless_type</a><span class="special">,</span> <span class="identifier">System2</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">Y2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">,</span> 
                    <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>implicit conversion between different unit systems is allowed </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System2<span class="special">,</span> <span class="keyword">typename</span> Y2<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="id-1_3_43_10_2_36_1_1_4_19-bb"></a><span class="identifier">quantity</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <a class="link" href="dimensionless_type.html" title="Struct dimensionless_type">dimensionless_type</a><span class="special">,</span> <span class="identifier">System2</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">Y2</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">,</span> 
                    <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>
<p>conversion between different unit systems is explicit when the units are not equivalent. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a name="id-1_3_43_10_2_36_1_1_4_13-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> YY<span class="special">&gt;</span> 
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
  <a name="id-1_3_43_10_2_36_1_1_4_16-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <a class="link" href="unit.html" title="Class template unit">unit</a><span class="special">&lt;</span> <span class="identifier">dimension_type</span><span class="special">,</span> <span class="identifier">system_type</span> <span class="special">&gt;</span><span class="special">,</span> <span class="identifier">YY</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>implicit assignment between value types is allowed if allowed for value types themselves </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System2<span class="special">&gt;</span> 
  <span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> 
  <a name="id-1_3_43_10_2_36_1_1_4_20-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="quantity.html" title="Class template quantity">quantity</a><span class="special">&lt;</span> <span class="identifier">BOOST_UNITS_DIMENSIONLESS_UNIT</span><span class="special">(</span><span class="identifier">System2</span><span class="special">)</span><span class="special">,</span> <span class="identifier">Y</span> <span class="special">&gt;</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>implicit assignment between different unit systems is allowed </li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.43.10.2.36.6.4.4"></a><h3>
<a name="id-1_3_43_10_2_36_1_1_4_9-bb"></a><code class="computeroutput">quantity</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <a name="id-1_3_43_10_2_36_1_1_4_9_1-bb"></a><span class="keyword">operator</span> <span class="identifier">value_type</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>implicit conversion to <code class="computeroutput">value_type</code> is allowed </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CONSTEXPR</span> <span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> <a name="id-1_3_43_10_2_36_1_1_4_9_2-bb"></a><span class="identifier">value</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>constant accessor to value <p>can add a quantity of the same type if add_typeof_helper&lt;value_type,value_type&gt;::type is convertible to value_type </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a name="id-1_3_43_10_2_36_1_1_4_9_3-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>can subtract a quantity of the same type if subtract_typeof_helper&lt;value_type,value_type&gt;::type is convertible to value_type </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a name="id-1_3_43_10_2_36_1_1_4_9_4-bb"></a><span class="keyword">operator</span><span class="special">-=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> source<span class="special">)</span><span class="special">;</span></pre>can multiply a quantity by a scalar value_type if multiply_typeof_helper&lt;value_type,value_type&gt;::type is convertible to value_type </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a name="id-1_3_43_10_2_36_1_1_4_9_5-bb"></a><span class="keyword">operator</span><span class="special">*=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> val<span class="special">)</span><span class="special">;</span></pre>can divide a quantity by a scalar value_type if divide_typeof_helper&lt;value_type,value_type&gt;::type is convertible to value_type </li>
<li class="listitem"><pre class="literallayout"><span class="identifier">BOOST_CXX14_CONSTEXPR</span> <span class="identifier">this_type</span> <span class="special">&amp;</span> <a name="id-1_3_43_10_2_36_1_1_4_9_6-bb"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> val<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.43.10.2.36.6.4.5"></a><h3>
<a name="id-1_3_43_10_2_36_1_1_4_21-bb"></a><code class="computeroutput">quantity</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">BOOST_CONSTEXPR</span> <span class="identifier">this_type</span> <a name="id-1_3_43_10_2_36_1_1_4_21_1-bb"></a><span class="identifier">from_value</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">value_type</span> <span class="special">&amp;</span> val<span class="special">)</span><span class="special">;</span></pre>Construct quantity directly from <code class="computeroutput">value_type</code>. </li></ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2003-2008 Matthias Christian Schabel<br>Copyright © 2007-2010 Steven
      Watanabe<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="quantity.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_units/Reference.html#header.boost.units.quantity_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="subtr_1_3_43_10_2_36_1_1_5.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
